<template>
  <div style="height: 100%">
    <el-row :gutter="27">
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
        <el-col :span="23">
          <el-row>
            <el-col :span="4">
              <el-form-item label="设备选择" prop="selectDevice">
                <el-select v-model="formData.selectDevice" placeholder="请选择设备" clearable :style="{ width: '100%' }">
                  <el-option v-for="(item, index) in selectDeviceOptions" :key="index" :label="item.label" :value="item.value" :disabled="item.disabled"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
      </el-form>
    </el-row>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        selectDevice: undefined,
      },
      rules: {
        selectDevice: [
          {
            required: true,
            message: "请选择设备",
            trigger: "change",
          },
        ],
      },
      selectDeviceOptions: [
        {
          label: "设备一",
          value: 1,
        },
        {
          label: "设备二",
          value: 2,
        },
        {
          label: "设备三",
          value: 3,
        },
      ],
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs["elForm"].validate((valid) => {
        if (!valid) return;
        // TODO 提交表单
      });
    },
    resetForm() {
      this.$refs["elForm"].resetFields();
    },
  },
};
</script>
<style lang="less" scoped>
.el-form-item {
  margin-bottom: 0px;
}
</style>
